<%@ page contentType="text/html;charset=UTF-8" language="java"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@ include file="common/global.jsp"%>
<%@ include file="common/meta.jsp"%>
<%@ include file="common/include-base-styles.jsp"%>
</head>

<body>
	<%@ include file="common/head.jsp"%>

	<div class="main-container" id="main-container">
		<script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

		<div class="main-container-inner">
			<%@ include file="common/sidebar.jsp"%>
			<div class="main-content">
				<%@ include file="common/bread.jsp"%>
				<div class="page-content">
					<!-- PAGE CONTENT START -->
					<div class="widget-box">
						<div class="widget-header">
							<h4>公文查询</h4>
						</div>
						<div class="widget-body">
							<div class="widget-main">
								<div class="form-group" style="height: 20px">
									<label class="control-label col-sm-1 no-padding-right"
										for="code">收发文标题:</label>
									<div class="col-sm-10">
										<input type="text" id="title" placeholder="收发文标题"
											class="col-sm-10" />
									</div>
									<button id="button">查询</button>
								</div>
								<table id="filepage">

								</table>
							</div>
						</div>
					</div>



					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.page-content -->

				<!-- /.page-content -->
			</div>
			<!-- /.main-content -->
		</div>
		<!-- /.main-container-inner -->

		<a href="#" id="btn-scroll-up"
			class="btn-scroll-up btn btn-sm btn-inverse"> <i
			class="icon-double-angle-up icon-only bigger-110"></i>
		</a>
	</div>
	<!-- /.main-container -->

	<!-- basic scripts -->
	<%@ include file="common/basicScripts.jsp"%>

	<script type="text/javascript">
$(function () {

    //1.初始化Table
    var oTable = new TableInit();
    oTable.Init();
    
  	//当点击查询按钮的时候执行  
    $("#button").bind("click", function(){
    	  $('#filepage').bootstrapTable('refresh');
    });  
	
});


var TableInit = function () {
    var oTableInit = new Object();
    //初始化Table
    oTableInit.Init = function () {
        $('#filepage').bootstrapTable({
            url: ctx+'/backworkflow/selectFile',         //请求后台的URL（*）        
            method: 'get',                      //请求方式（*）
            striped: true,                      //是否显示行间隔色
            cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
            queryParams: oTableInit.queryParams,//传递参数（*）
            pagination: false,  //开启分页  
            height:300,        
            columns: [{
                field: 'subject',
                title: '公文标题'
            }, {
                field: 'orgMember.name',
                title: '起草人'
            }, {
                field: 'startTime',
                title: '起草时间'
            }, {
                field: 'docMark',
                title: '文号'
            }, {
                field: 'operation',
                title: '操作',
                formatter:function(value,row,index){
                	return "<a href='"+ctx+"/backworkflow/selectopinionview?id="+row.id+"'>进入</a>"
                }
            } ]
        });
    };

    //得到查询的参数
    oTableInit.queryParams = function (params) {
        var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            title: $("#title").val()
        };
        return temp;
    };
    
    
    return oTableInit;
};


</script>
</body>
</html>

